package debux.apps.mltr.app;

import android.app.TabActivity;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.TabHost;
import android.widget.TextView;

public class MainActivity extends TabActivity  {
	public static TabHost.TabSpec tabSpec;
	@Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        TabHost mTabHost = getTabHost();
        Intent intent;
        mTabHost.addTab(mTabHost.newTabSpec("tab_about").setIndicator(createTabView(this, "MLTR")).setContent(R.id.about_tab));
        intent = new Intent(MainActivity.this, AlbumActivity.class);
        mTabHost.addTab(mTabHost.newTabSpec("tab_albums").setIndicator(createTabView(this, "Albums")).setContent(intent));
        intent = new Intent(MainActivity.this, SongActivity.class);        
        mTabHost.addTab(mTabHost.newTabSpec("tab_songs").setIndicator(createTabView(this, "Songs")).setContent(intent));
        intent = new Intent(MainActivity.this, VideoActivity.class);        
        mTabHost.addTab(mTabHost.newTabSpec("tab_videos").setIndicator(createTabView(this, "Videos")).setContent(intent));
        mTabHost.setCurrentTabByTag("tab_albums");
    }
	
	private static View createTabView(final Context context, final String text) {
		View view = LayoutInflater.from(context).inflate(R.layout.tabs_bg, null);
		TextView tv = (TextView) view.findViewById(R.id.tabsText);
		tv.setText(text);
		return view;
	}
}
